package ru.ifmo.rybakov.muclumon.msvs.proxy;

import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

public class Main {

	private static final Logger logger = LoggerFactory.getLogger(Main.class);
	
	/**
	 * @param args
	 */
	public static void main(String[] args) {
		MSVSProxyPollingDaemon daemon = new MSVSProxyPollingDaemon();
		daemon.start();
		
		BufferedReader reader = new BufferedReader(new InputStreamReader(System.in));
		
		while (true) {
			try {
				String cmd = reader.readLine();
				if ("exit".equals(cmd.toLowerCase())) {
					daemon.stop();
					logger.info("Me says 'goodbye'");
					break;
				}
			} catch (IOException e) {
				logger.error("Unexpected exception", e);
			}
			
		}
	}

}
